package dbUtil.handler;

import dbUtil.ResultsetHandler;
import dbUtil.Row;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class MapListHandler implements ResultsetHandler<List<Map<String, Object>>> {
    public List<Map<String, Object>> handler(ResultSet rs) throws SQLException {
        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
        while (rs.next()) {
            list.add(Row.toMap(rs));
        }
        return list;
    }
}
